#include <iostream>
#include <vector>
#include <unordered_map>
#include <vector>


using namespace std;

unordered_map<int,int> m;

int fourSumCount(vector<int>& nums1, vector<int>& nums2, vector<int>& nums3, vector<int>& nums4) {
    int res=0;
    for (auto a:nums1)
        for (auto b:nums2){
            m[a+b]++;
        }
    for (auto c:nums3)
        for (auto d:nums4){
            if (m.find(0-c-d)!=m.end()){
                res+=m[0-c-d];
            }
        }
    return res;
}

int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    vector<int> nums1,nums2,nums3,nums4;
    for (int i=0;i<a;i++){
        int temp;
        cin>>temp;
        nums1.push_back(temp);
    }
    for (int i=0;i<b;i++){
        int temp;
        cin>>temp;
        nums2.push_back(temp);
    }
    for (int i=0;i<c;i++){
        int temp;
        cin>>temp;
        nums3.push_back(temp);
    }
    for (int i=0;i<d;i++){
        int temp;
        cin>>temp;
        nums4.push_back(temp);
    }
    cout<<fourSumCount(nums1,nums2,nums3,nums4)<<endl;
    return 0;
}